CC = gcc
CFLAGS = -c -Wall

all: snakegame

snakegame: game.o graphics.o networking.o point.o snake.o tty.o
	$(CC) game.o graphics.o networking.o point.o snake.o tty.o -o snakegame -lpthread
	
game.o: game.c game.h
	$(CC) $(CFLAGS) game.c

graphics.o: graphics.c graphics.h
	$(CC) $(CFLAGS) graphics.c

networking.o: networking.c networking.h
	$(CC) $(CFLAGS) networking.c

point.o: point.c point.h
	$(CC) $(CFLAGS) point.c

snake.o: snake.c snake.h
	$(CC) $(CFLAGS) snake.c

tty.o: tty.c tty.h
	$(CC) $(CFLAGS) tty.c

clean:
	rm -rf *.o snakegame
